package com.spring.controller;

import com.alibaba.fastjson2.JSONObject;
import com.spring.mqtt.MqttGateway;
import com.spring.mqtt.MqttReturn;
import com.spring.mqtt.MqttTopicUtils;
import com.spring.mqtt.annotation.*;
import org.springframework.beans.factory.annotation.Autowired;

@MqttController
public class MqttHearBeatController {

    @Autowired
    MqttGateway mqttGateway;

    @MqttSubscirbe(topic = "AlarmSystem/MobileApp/{authorization}/HeartBeat/{type}",qos = 2)
    @MqttTopicFilter(map = {@MqttTopicMap(key = "type", value = "ret")
    },level = { @MqttTopicLevel(index = 2, name = "123",type = MqttTopicFilterType.StartsWith)})
    public MqttReturn heartBeat(MqttTopicUtils res, JSONObject data){
        System.out.println(res);
        System.out.println(data);
        return null;
    }


}
